home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / __Packages / com / robertpenner / easing / Quad.as < prev    next >
Text File  |  2009-11-16  |  659b  |  31 lines

  1. class com.robertpenner.easing.Quad
  2. {
  3.    function Quad()
  4.    {
  5.    }
  6.    static function easeIn(t, b, c, d)
  7.    {
  8.       return c * (t /= d) * t + b;
  9.    }
  10.    static function easeOut(t, b, c, d)
  11.    {
  12.       return (- c) * (t /= d) * (t - 2) + b;
  13.    }
  14.    static function easeInOut(t, b, c, d)
  15.    {
  16.       if((t /= d / 2) < 1)
  17.       {
  18.          return c / 2 * t * t + b;
  19.       }
  20.       return (- c) / 2 * ((t = t - 1) * (t - 2) - 1) + b;
  21.    }
  22.    static function easeOutIn(t, b, c, d)
  23.    {
  24.       if((t /= d / 2) < 1)
  25.       {
  26.          return (- c) / 2 * ((t = t - 1) * t - 1) + b;
  27.       }
  28.       return c / 2 * ((t = t - 1) * t + 1) + b;
  29.    }
  30. }
  31.